Skip to content

feat: MAUI integration hooks and refactor for 0.4.1 nuget#425

Merged
abelonogov-ld merged 50 commits into
mainfrom
andrey/recordlog-android
Mar 26, 2026
Merged

feat: MAUI integration hooks and refactor for 0.4.1 nuget#425
abelonogov-ld merged 50 commits into
mainfrom
andrey/recordlog-android

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld commented Mar 19, 2026

Summary

Refactors the Android Observability SDK architecture to align with the iOS/Swift and MAUI integration patterns, decoupling the Observability plugin from SessionReplay so each can function independently.

Architectural Changes

  • Decoupled plugin dependency direction: SessionReplayService can depend on Observability, but Observability no longer depends on SessionReplay. Removed InstrumentationContributor, InstrumentationContributorManager, and the LDExtendedInstrumentation-based registration flow.
  • Renamed for parity with Swift: ReplayInstrumentationSessionReplayService, ReplayControlSessionReplayServicing.
  • Simplified log processing pipeline: Removed RoutingLogRecordProcessor and the per-instrumentation log routing mechanism from InstrumentationManager, since it was only used by session replay and no longer needed.
  • SessionManager exposed via context: InstrumentationManager now captures the OTel SessionManager via a lightweight bridge AndroidInstrumentation and exposes it through ObservabilityClientObservabilityContext.sessionManager, matching the Swift pattern.

Session Replay Changes

  • Plugin lifecycle: SessionReplay.register() directly creates SessionReplayService using LDObserve.context, wires it to LDReplay, and sets the hook delegate. SessionReplay.onPluginsReady() calls sessionReplayService.initialize() after SessionManager is available.
  • Hook refactoring: SessionReplayHook no longer holds a reference to the SessionReplay plugin. Instead, it uses a @Volatile delegate of type SessionReplayServicing and extracts context keys from SDK types before delegating.
  • afterIdentify moved to service layer: Context key extraction and LDContext building now happen in SessionReplayService.afterIdentify() and SessionReplayHook.afterIdentify() respectively, using a Map<String, String> interface for cross-platform compatibility.
  • New SessionReplayHookProxy: JVM adapter for the C#/MAUI bridge that accepts simple JVM types and delegates to SessionReplayServicing.
  • Wake-up events: Added RRWebEventGenerator.generateWakeUpEvents() and SessionReplayExporter.wakeUpEvents() to re-trigger player playback after session resumption with a reload event and synthetic mouse interactions.
  • Title propagation: RRWebEventGenerator now accepts a title parameter used in reload custom events, derived from the application name.

New Utilities

  • AttributeConverter: Converts untyped Map<String, Any?> dictionaries (from bridge layers like .NET MAUI) into OTel Attributes, with support for nested map flattening via dot-separated keys and typed list handling.

Note

Medium Risk
Medium risk due to refactoring plugin wiring and session replay export behavior (new wake-up payloads) plus removal of custom instrumentation/log-routing hooks, which could affect initialization order and telemetry/replay delivery.

Overview
Refactors the Android Observability + Session Replay integration to remove the LDExtendedInstrumentation contributor flow and instead initialize Session Replay directly from the SessionReplay plugin, while Observability now captures and shares the OTel SessionManager via LDObserve.context.

Session Replay is renamed/reshaped into SessionReplayService/SessionReplayServicing, with identify handling routed through a delegate-based SessionReplayHook plus a new MAUI-friendly SessionReplayHookProxy. Replay exporting now propagates an app title, emits a one-time “wake-up” payload (reload + synthetic interactions) after pushing events, and sets client_id to observability-android in the replay session init call.

Adds bridge-friendly APIs for MAUI: LDObserve.recordLog(message, severityNumber, attributesMap) / recordError(message, cause) backed by a new AttributeConverter (flattening nested maps and typing lists). Updates e2e UI copy and benchmark generator construction, and simplifies/updates tests to match the new architecture.

Written by Cursor Bugbot for commit cae622e. This will update automatically on new commits. Configure here.

* main:
  feat: Optional Jet Compose (#402)
  feat: Android Incremental Image Diff compression (#390)
  chore: add CLAUDE.md (#398)
  chore: release main (#400)
  fix: correct react native session replay build step (#399)
  chore: release main (#396)
  fix: Android span e2e tests (#397)
  fix: improve network response capture (#379)

# Conflicts:
#	sdk/@launchdarkly/mobile-dotnet/.vscode/tasks.json
(cherry picked from commit f883e975ca79da891b4178d8a12e27868f0931eb)
* main:
  chore: release main (#401)
(cherry picked from commit 9901600)
* main:
  chore: release main (#406)
  feat: Make Android SDK35 compilable (#405)
* andrey/hooks:
  comment identify stuff
  fat working
  working
  can launch
* main:
  chore: release main (#419)
  feat: Use C and NEON for hashing (Optimization) 100x on Pixel 8 (#415)
  chore: release main (#418)
  feat: Android SR use Jpeg 0.3 quality (#417)
  chore: release main (#411)
  feat: CPU utilization optimization in image diff calculations (#414)
  fix: reset nodeIds during fullsnapshot (#412)
  chore: Android benchmark screen of SR data pipelines on iOS Raw Frames (#410)
  feat: Android Observability hook  proxy for MAUI (#409)
  feat: ruby observability plugin (#360)

# Conflicts:
#	sdk/@launchdarkly/mobile-dotnet/android/native/LDObserve/src/main/java/com/example/LDObserve/ObservabilityBridge.kt
#	sdk/@launchdarkly/mobile-dotnet/macios/native/LDObserve/Sources/ObservabilityBridge.swift
#	sdk/@launchdarkly/mobile-dotnet/observability/LDAPI/LDObserve.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.Fat.csproj
#	sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.csproj
#	sdk/@launchdarkly/mobile-dotnet/observability/bridge/LDObserve.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/bridge/NativeHookProxy.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/observe/api/LDObserve.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/observe/plugin/ObservabilityHook.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/observe/plugin/ObservabilityPlugin.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/replay/plugin/SessionReplayHook.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/replay/plugin/SessionReplayPlugin.cs
#	sdk/@launchdarkly/mobile-dotnet/sample/MauiProgram.cs
* main:
  feat: mobile-dotnet support init attributes (#420)

# Conflicts:
#	sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.Fat.csproj
#	sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.csproj
#	sdk/@launchdarkly/mobile-dotnet/observability/bridge/DictionaryTypeConverters.cs
@abelonogov-ld abelonogov-ld requested a review from a team as a code owner March 19, 2026 15:23
@abelonogov-ld abelonogov-ld changed the title feat: MAUI integration hooks feat: MAUI integration hooks and refactor Mar 19, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@abelonogov-ld abelonogov-ld changed the title feat: MAUI integration hooks and refactor feat: MAUI integration hooks and refactor for 0.4.1 nuget Mar 25, 2026
@abelonogov-ld abelonogov-ld enabled auto-merge (squash) March 26, 2026 17:44
@abelonogov-ld abelonogov-ld disabled auto-merge March 26, 2026 18:43
* main:
  build: use cocopods instead of swift package manager in podspec (#431)
  fix: handle bool type in FormatAttributes (#430)
  chore: [SEC-7924] pin third-party GitHub Actions to commit SHAs (#429)
…servability-sdk into andrey/recordlog-android

* 'andrey/recordlog-android' of github.com:launchdarkly/observability-sdk:
@abelonogov-ld abelonogov-ld merged commit 33f6d6c into main Mar 26, 2026
24 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/recordlog-android branch March 26, 2026 21:34
Vadman97 pushed a commit that referenced this pull request Mar 26, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-observability-python: 1.2.0</summary>

##
[1.2.0](launchdarkly-observability-python-1.1.0...launchdarkly-observability-python-1.2.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
</details>

<details><summary>launchdarkly-observability-android: 0.32.0</summary>

##
[0.32.0](launchdarkly-observability-android-0.31.0...launchdarkly-observability-android-0.32.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
* MAUI integration hooks and refactor for 0.4.1 nuget
([#425](#425))
([33f6d6c](33f6d6c))
</details>

<details><summary>go: 1.1.0</summary>

##
[1.1.0](go/v1.0.0...go/v1.1.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
</details>

<details><summary>launchdarkly-observability-dotnet: 1.1.0</summary>

##
[1.1.0](launchdarkly-observability-dotnet-1.0.0...launchdarkly-observability-dotnet-1.1.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
</details>

<details><summary>observability: 1.1.0</summary>

##
[1.1.0](observability-1.0.3...observability-1.1.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * highlight.run bumped to 9.28.0
</details>

<details><summary>observability-node: 1.1.0</summary>

##
[1.1.0](observability-node-1.0.1...observability-node-1.1.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
</details>

<details><summary>observability-react-native: 0.8.0</summary>

##
[0.8.0](observability-react-native-0.7.1...observability-react-native-0.8.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
</details>

<details><summary>session-replay: 1.1.0</summary>

##
[1.1.0](session-replay-1.0.3...session-replay-1.1.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * highlight.run bumped to 9.28.0
</details>

<details><summary>session-replay-react-native: 0.3.0</summary>

##
[0.3.0](session-replay-react-native-0.2.2...session-replay-react-native-0.3.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/observability-react-native bumped to 0.8.0
</details>

<details><summary>highlight.run: 9.28.0</summary>

##
[9.28.0](highlight.run-9.27.1...highlight.run-9.28.0)
(2026-03-26)


### Features

* **@launchdarkly/session-replay-react-native:** use cocoapods for
native session replay
([#434](#434))
([41988e1](41988e1))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this is a Release Please version/changelog bump across
packages with no functional code changes beyond version constants and
manifests.
> 
> **Overview**
> Cuts a new coordinated release by bumping versions across Go,
web/Node/React-Native, Android, .NET, Python, Session Replay, and
`highlight.run`, updating `.release-please-manifest.json` and each
package’s `CHANGELOG.md`.
> 
> Also updates package metadata/version declarations (e.g.,
`package.json`, `pyproject.toml`, `gradle.properties`, `.csproj`, and Go
`InstrumentationVersion`) and notes the `highlight.run` dependency bump
to `9.28.0`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
26333ff. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants